﻿using Bigway.Common.Models.DtoModels;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;

namespace Bigway.Common.Controllers;

[ApiController]
[Route("api/version")]
public class VersionController(IConfiguration configuration): ControllerBase
{
    [HttpGet]
    public GetVersionResponseDto GetVersion()
    {
        return new GetVersionResponseDto
        {
            Data = new VersionInfo
            {
                Version = configuration.GetValue<string>("ServerVersion") ?? "",
                BuildId = configuration.GetValue<string>("ServerBuildId") ?? "",
            }
        };
    }
}